package com.neuedu.homework;

public class HourlyEmployee extends ColaEmployee {
    //成员变量

    private double hourlySalary;
    private double monthHours;

    //行为方法

    @Override
    public double getSalary(int month) {
        //计算时薪员工工资
        double mySalary = hourlySalary+monthHours;
        //超出部分
        if (monthHours>160){
            mySalary+=(monthHours-160)*0.5*hourlySalary;
        }
        //计算有没有生日金
        mySalary+=super.getSalary(month);
        return mySalary;
    }

    public double getHourlySalary() {
        return hourlySalary;
    }

    public void setHourlySalary(double hourlySalary) {
        this.hourlySalary = hourlySalary;
    }

    public double getMonthHours() {
        return monthHours;
    }

    public void setMonthHours(double monthHours) {
        this.monthHours = monthHours;
    }

    public HourlyEmployee(String empName, int empBirthdayMonth, double hourlySalary, double monthHours) {
        super(empName, empBirthdayMonth);
        this.hourlySalary = hourlySalary;
        this.monthHours = monthHours;
    }

    public HourlyEmployee() {
    }
}
